package com.hysf.entity;

import java.util.Date;
import java.util.Objects;
/**
 *
 * @Description:
 *
 * @Author: 石涛
 * @Date: 2024/4/9 10:51
 **/
public class Product {
    /*
	 * `pid` varchar(32) NOT NULL,
		  `pname` varchar(50) DEFAULT NULL,
		  `market_price` double DEFAULT NULL,

		  `shop_price` double DEFAULT NULL,
		  `pimage` varchar(200) DEFAULT NULL,
		  `pdate` date DEFAULT NULL,

		  `is_hot` int(11) DEFAULT NULL,
		  `pdesc` varchar(255) DEFAULT NULL,
		  `pflag` int(11) DEFAULT NULL,

		  `cid` varchar(32) DEFAULT NULL,
	 */
    private String pid;
    private String pname;
    private Double market_price;

    private Double shop_price;
    private String pimage;
    private Date pdate;

    private Integer is_hot;  //是否热门  1:热门    0:不热门
    private String pdesc;
    private Integer pflag;	//是否下架    1:下架	0:未下架

    //在多的一方放入一个一的一方的对象 用来表示属于那个分类
    private String cid;

    public Product() {
    }

    public Product(String pid, String pname, Double market_price, Double shop_price, String pimage, Date pdate, Integer is_hot, String pdesc, Integer pflag, String cid) {
        this.pid = pid;
        this.pname = pname;
        this.market_price = market_price;
        this.shop_price = shop_price;
        this.pimage = pimage;
        this.pdate = pdate;
        this.is_hot = is_hot;
        this.pdesc = pdesc;
        this.pflag = pflag;
        this.cid = cid;
    }

    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid;
    }

    public String getPname() {
        return pname;
    }

    public void setPname(String pname) {
        this.pname = pname;
    }

    public Double getMarket_price() {
        return market_price;
    }

    public void setMarket_price(Double market_price) {
        this.market_price = market_price;
    }

    public Double getShop_price() {
        return shop_price;
    }

    public void setShop_price(Double shop_price) {
        this.shop_price = shop_price;
    }

    public String getPimage() {
        return pimage;
    }

    public void setPimage(String pimage) {
        this.pimage = pimage;
    }

    public Date getPdate() {
        return pdate;
    }

    public void setPdate(Date pdate) {
        this.pdate = pdate;
    }

    public Integer getIs_hot() {
        return is_hot;
    }

    public void setIs_hot(Integer is_hot) {
        this.is_hot = is_hot;
    }

    public String getPdesc() {
        return pdesc;
    }

    public void setPdesc(String pdesc) {
        this.pdesc = pdesc;
    }

    public Integer getPflag() {
        return pflag;
    }

    public void setPflag(Integer pflag) {
        this.pflag = pflag;
    }

    public String getCid() {
        return cid;
    }

    public void setCid(String cid) {
        this.cid = cid;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Product product = (Product) o;
        return Objects.equals(pid, product.pid) && Objects.equals(pname, product.pname) && Objects.equals(market_price, product.market_price) && Objects.equals(shop_price, product.shop_price) && Objects.equals(pimage, product.pimage) && Objects.equals(pdate, product.pdate) && Objects.equals(is_hot, product.is_hot) && Objects.equals(pdesc, product.pdesc) && Objects.equals(pflag, product.pflag) && Objects.equals(cid, product.cid);
    }

    @Override
    public int hashCode() {
        return Objects.hash(pid, pname, market_price, shop_price, pimage, pdate, is_hot, pdesc, pflag, cid);
    }

    @Override
    public String toString() {
        return "Product{" +
                "pid='" + pid + '\'' +
                ", pname='" + pname + '\'' +
                ", market_price=" + market_price +
                ", shop_price=" + shop_price +
                ", pimage='" + pimage + '\'' +
                ", pdate=" + pdate +
                ", is_hot=" + is_hot +
                ", pdesc='" + pdesc + '\'' +
                ", pflag=" + pflag +
                ", cid='" + cid + '\'' +
                '}';
    }
}
